<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="utf-8"%>
<%@ page import="com.csis.system.common.WebUtil" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>仓库信息</title>
<jsp:include page="/common.jsp" />
<script type="text/javascript">
var options={
		create:{
			url:'${pageContext.request.contextPath}/system/ware/toAdd.htm',
			title:'新增仓库信息',
			width:480,
			height:220
		},

		view:{
			url:'${pageContext.request.contextPath}/system/ware/toView.htm',
			title:'仓库详细',
			width:480,
			height:250
		},

		modify:{
			url:'${pageContext.request.contextPath}/system/ware/toEdit.htm',
			title:'编辑仓库信息',
			width:480,
			height:220
		},
			
		remove:{
			url:'${pageContext.request.contextPath}/system/ware/toDel.htm'
		}
	};
	
	function assign(){
		var id=$("#lister").jqGrid('getGridParam','selarrrow');
		id=id.toString();
		if (id===""||id.split(",").length==0) {
			$.messager.alert('警告','请选择一条记录！','warning');
			return;
		}
		if (id.split(",").length > 1) {
			$.messager.alert('警告','只能选一条记录！','warning');
			return;
		}
		var url="${pageContext.request.contextPath}/system/ware/toAssign.htm?bean.id="+id;
		
		open('win2', url, "指派负责人", 550, 300);
	}
</script>
</head>

<body>
	<table cellpadding="0" cellspacing="0" width="100%" height="100%">
		<tbody>
			<tr>
				<td>
					<div class="toolbar" style="background-color: #e0e0e0;">
							<a plain="true" href="javascript:void(0);"
								class="easyui-linkbutton" iconCls="icon-add" onclick="toDo(options,'C');">新增</a> 
							<a plain="true" href="javascript:void(0);"
							class="easyui-linkbutton" iconCls="icon-search" onclick="toDo(options,'V');">查看</a>
							<a plain="true" href="javascript:void(0);"
								class="easyui-linkbutton" iconCls="icon-save" onclick="toDo(options,'M');">编辑</a>
							<a plain="true" href="javascript:void(0);"
								class="easyui-linkbutton" iconCls="icon-remove" onclick="toDo(options,'R');">删除</a>
							<a plain="true" href="javascript:void(0);" 
								class="easyui-linkbutton" iconCls="icon-mini-edit" onclick="assign();">指派负责人</a> 
					</div>
				</td>
			</tr>
			
			<tr>
				<td height="100%" valign="top" width="100%">
					<table id="lister" name="lister" style="width:100%;height:100%"></table>
					<div id="pager"></div>
				</td>
			</tr>
		</tbody>
	</table>
	<div id='win' class='easyui-window' title='New Window' style='width:400px;height:300px;padding:5px;' closed='true'>
	</div>
	<div id='win2' class='easyui-window' title='New Window' style='width:400px;height:300px;padding:5px;' closed='true'>
	</div>
	<script>
     $(document).ready(function(){
    	 $("#lister")
			.jqGrid(
					{
						url : "${pageContext.request.contextPath }/system/ware/listBy.htm",
						datatype : "json",
						colNames : [ '编号', '仓库名称'],
						colModel : [ 
									{name : 'id',index : 'ware_id',width : 200}, 
									{name : 'wareName',index : 'ware_name',width : 450}
									],
						rowNum : 20,
						shrinkToFit: true,
						rowList : [ 10, 20, 30 ],
						pager : '#pager',
						sortname : 'ware_id',
						viewrecords : true,
						sortorder : "asc",
						mtype: "POST",
						multiselect: true,
						width:'100%',
						height: 'auto',
						width:'90%',
					});
		$("#lister").jqGrid('navGrid','#pager', {edit : false,add : false,del : false});
      });
	</script>
</body>
</html>